class Solution:
    def decodeMessage(self, key: str, message: str) -> str:
        char_dict = {}
        char_num = 97
        res = ""
        for i in key:
            if i == ' ':
                continue
            if i not in char_dict:
                char_dict[i] = char_num
                char_num +=1
        for i in message:
            if i ==' ':
                res+=i
            else:
                res+= chr(char_dict[i])
        return res


if __name__ == '__main__':
    key = "eljuxhpwnyrdgtqkviszcfmabo"
    message = "zwx hnfx lqantp mnoeius ycgk vcnjrdb"
    solution = Solution()
    val = solution.decodeMessage(key ,message)
    print(val)